<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>后台管理</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<!-- styles -->
<link rel="stylesheet" type="text/css" href="../../../assets/common/jquery-easyui/themes/custom/easyui.css">
<link rel="stylesheet" type="text/css" href="../../../assets/common/jquery-easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../../../assets/common/jquery-easyui-custom/easyui.custom.css">
<!-- icon -->
<link rel="icon" type="image/x-icon" href="../../../../assets/common/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="../../../../assets/common/favicon.ico" />
<!-- scripts -->
<script type="text/javascript" src="../../../assets/common/jquery-easyui/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../../../assets/common/jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../../assets/common/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../../assets/common/jquery-easyui-custom/easyui.custom.js"></script>
<script type="text/javascript" src="../../../assets/common/framework.js"></script>
<!-- page scripts -->
<script type="text/javascript">
	$(function() {
		$('#pg-users').propertygrid({
			showGroup : true,
			columns : [[{
						field : 'loginName',
						title : '用户名'
					}, {
						field : 'loginPass',
						title : '密码'
					}]],
			data : [{
						group : '管理员',
						loginName : 'admin',
						loginPass : 'admin'
					}, {
						group : '管理员',
						loginName : 'root',
						loginPass : 'root'
					}, {
						group : '普通用户',
						loginName : 'zhangsan',
						loginPass : '1'
					}, {
						group : '普通用户',
						loginName : 'lisi',
						loginPass : '1'
					}, {
						group : '普通用户',
						loginName : 'wangwu',
						loginPass : '1'
					}]
		});
		if (top.location !== self.location) {
			top.location = self.location;
		}
		window.onresize = function() {
			$('#dlg').dialog('center');
		}
		$('body').keydown(function(event) {
			if (event.keyCode == '13') {
				func_login();
			}
		});
		$('#dlg #loginName').textbox('textbox').focus();
	});
	function func_login() {
		$('#fm').form('submit', {
			url : AppCore.baseUrl + 'admin/common/login',
			onSubmit : function() {
				return $(this).form('validate');
			},
			success : function(data) {
				var data = eval('(' + data + ')');
				if (data.success) {
					window.location.href = AppCore.baseUrl + 'web/admin/common/main.html';
				} else {
					$.messager.show({
						title : '错误',
						msg : data.msg,
						showType : 'fade',
						style : {
							right : '',
							bottom : ''
						}
					});
				}
			}
		});
	}
</script>
</head>

<body>
	<div id="dlg" class="easyui-dialog" style="width:400px;height:250px;"
		data-options="title:'用户登录',closable:false,buttons:'#dlg-btn'">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'north',border:false" style="height:70px;overflow:hidden;border-bottom: 1px solid #95b8e7;">
				<img src="../../../assets/common/login/login.png" />
			</div>
			<div data-options="region:'center',border:false" style="padding:20px 30px;">
				<form id="fm" method="post">
					<div style="text-align:center;">
						<table style="border-width:0;" align="center">
							<tr>
								<td style="text-align: right;">用户名：</td>
								<td><input type="text" id="loginName" name="loginName" class="easyui-textbox" data-options="required:true" /></td>
							</tr>
							<tr>
								<td style="text-align: right;">密码：</td>
								<td><input type="password" name="loginPass" class="easyui-textbox" data-options="required:true" /></td>
							</tr>
						</table>
					</div>
				</form>
			</div>
		</div>
		<div id="dlg-btn">
			<a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-accept'" onclick="func_login()">登录</a>
			<a href="javascript:;" class="easyui-menubutton" data-options="iconCls:'icon-cog',menu:'#menu',plain:false">选项</a>
			<div id="menu" style="width:120px;">
				<div data-options="iconCls:'icon-tip'" onclick="$('#dlg-users').dialog('open').window('center')">说明</div>
				<div data-options="iconCls:'icon-help'" onclick="">帮助</div>
			</div>
		</div>
	</div>
	<div id="dlg-users" class="easyui-dialog" style="width:200px;padding:8px;"
		data-options="title:'用户列表',closed:true,buttons:'#dlg-btn-users'">
		<table id="pg-users"></table>
		<div id="dlg-btn-users">
			<a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="$('#dlg-users').dialog('close')">关闭</a>
		</div>
	</div>
</body>
</html>
